package com.numberone.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.numberone.system.mapper.XyOrderMapper;
import com.numberone.system.domain.XyOrder;
import com.numberone.system.service.IXyOrderService;
import com.numberone.common.support.Convert;

/**
 * 商品订单 服务层实现
 * 
 * @author numberone
 * @date 2020-09-29
 */
@Service
public class XyOrderServiceImpl implements IXyOrderService 
{
	@Autowired
	private XyOrderMapper xyOrderMapper;

	/**
     * 查询商品订单信息
     * 
     * @param id 商品订单ID
     * @return 商品订单信息
     */
    @Override
	public XyOrder selectXyOrderById(Long id)
	{
	    return xyOrderMapper.selectXyOrderById(id);
	}
	
	/**
     * 查询商品订单列表
     * 
     * @param xyOrder 商品订单信息
     * @return 商品订单集合
     */
	@Override
	public List<XyOrder> selectXyOrderList(XyOrder xyOrder)
	{
	    return xyOrderMapper.selectXyOrderList(xyOrder);
	}
	
    /**
     * 新增商品订单
     * 
     * @param xyOrder 商品订单信息
     * @return 结果
     */
	@Override
	public Long insertXyOrder(XyOrder xyOrder)
	{
	    return xyOrderMapper.insertXyOrder(xyOrder);
	}
	
	/**
     * 修改商品订单
     * 
     * @param xyOrder 商品订单信息
     * @return 结果
     */
	@Override
	public int updateXyOrder(XyOrder xyOrder)
	{
	    return xyOrderMapper.updateXyOrder(xyOrder);
	}

	/**
	 * 删除订单
	 * @param id 需要删除的数据ID
	 * @return
	 */
	@Override
	public int deleteXyOrderById(Long id) {
		return xyOrderMapper.deleteXyOrderById(id);
	}

	/**
     * 删除商品订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteXyOrderByIds(String ids)
	{
		return xyOrderMapper.deleteXyOrderByIds(Convert.toStrArray(ids));
	}

	/**
	 * 根据订单号查询商品订单
	 * @param orderNum
	 * @return
	 */
	@Override
	public List<XyOrder> selectXyOrderByOrderNum(String orderNum) {
		return xyOrderMapper.selectXyOrderByOrderNum(orderNum);
	}

}
